﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="WorkFlow_WFDesigner_NodeEdit" ValidateRequest="false" Codebehind="NodeEdit.aspx.cs" %>

<%@ Register Src="UserControl/BaseNode.ascx" TagName="BaseNode" TagPrefix="uc1" %>
<%@ Register Src="UserControl/MunualNode.ascx" TagName="MunualNode" TagPrefix="uc2" %>
<%@ Register Src="UserControl/DecisionNode.ascx" TagName="DecisionNode" TagPrefix="uc3" %>
<%@ Import Namespace="Honestysoft.Workflow.Model"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>编辑活动节点</title>
    <base target="_self" />
       <meta http-equiv="Pragma" content="no-cache" />
       <meta http-equiv="Cache-Control" content="no-cache"/>
       <meta http-equiv="Expires" content="0"/> 
       <link href="../Styles/control.css" rel="stylesheet" type="text/css" />
    <link href="../css/tab/tab.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../css/tab/tab.js"></script>
    <script language="javascript" type="text/javascript" src="../js/WFWinCtrlScript.js"></script>
    <script language="javascript" type="text/javascript" src="../js/GridCheckBox.js"></script>   
</head>
<body>
    <form id="form1" runat="server">    
    
    <div class="page_margin" style="margin:5px"> 
  <div class="nTab_l">

    <div class="TabTitle_l">
      <ul id="myTab_l">     
        <li id='li0' class="active" onclick="nTabs(this,0);">基本信息</li>
    <%if(Request["ActType"]+"" == ((int)Honestysoft.Workflow.Model.WFEnumData.ActType.Manual).ToString()) { %>    
        <li id='li1' class="normal" onclick="nTabs(this,1);">指派</li> 
        <li id='li2' class="normal" onclick="nTabs(this,2);">依赖</li> 
        <%} else { %>
        <li id='li1' class="normal" style="display:none;" onclick="nTabs(this,1);">指派</li> 
        <li id='li2' class="normal" style="display:none;"  onclick="nTabs(this,2);">依赖</li><%} %>
 <%if(Request["ActType"]+"" == ((int)Honestysoft.Workflow.Model.WFEnumData.ActType.Manual).ToString()
       || Request["ActType"]+"" == ((int)Honestysoft.Workflow.Model.WFEnumData.ActType.Start).ToString()) { %>       
        <li id='li3' class="normal" onclick="nTabs(this,3);">后续操作</li>
        <li id='li4' class="normal" onclick="nTabs(this,4);">扩展属性</li>
        <%}else{ %>
        <li id='li3' class="normal" style="display:none;" onclick="nTabs(this,3);">后续操作</li>
        <li id='li4' class="normal" style="display:none;" onclick="nTabs(this,4);">扩展属性</li><%} %>
      </ul>
    </div>
<%if(Request["ActType"]+"" == ((int)Honestysoft.Workflow.Model.WFEnumData.ActType.Manual).ToString()) {%>
    <div class="TabContent_l" style="height:570px;overflow-y:hidden"><%}else{ %>
    <div class="TabContent_l" style="height:220px;overflow-y:hidden"><%} %>
    
        <div id="myTab_l_Content0" >
            <table width="98%">
                <tr>
                    <td>
                        <uc1:BaseNode ID="BaseNode1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <uc2:MunualNode ID="MunualNode1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
            <uc3:DecisionNode ID="DecisionNode1" runat="server" /></td>
                </tr>
            </table>
        </div>
        
        <div id="myTab_l_Content1" class="none" style="height:100%;overflow-y:hidden;vertical-align:top" align="left" >
            <div align="right" class="button_area" style="width:98%" > 
                        <asp:Button ID="btnAddOrg"  runat="server" OnClientClick="return SelectEmployee();"  Text="选择组织机构" OnClick="btnAddOrg_Click"  class="btn_big_normal" 
                onmouseover="this.className='btn_big_active'" 
                onmouseout="this.className='btn_big_normal'" />    
    <asp:Button ID="btnAddPreActTemplate" runat="server" Text="选择流程角色"  OnClick="btnAddPreActTemplate_Click"  class="btn_big_normal" 
                onmouseover="this.className='btn_big_active'" 
                onmouseout="this.className='btn_big_normal'" />
                <asp:Button ID="btnExternalInterface" runat="server"  class="btn_big_normal"  onmouseover="this.className='btn_big_active'" 
                onmouseout="this.className='btn_big_normal'" Text="选择存储过程" OnClientClick="return SelectProcedure();" OnClick="btnExternalInterface_Click" />
    <asp:Button ID="btnDelTransactor" Text="删除"   runat="server" OnClick="btnDelTransactor_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />
                      
                    </div>
                    <div style="overflow-y:scroll;height:500px;">
            <table width="96%"  border="1" cellspacing="0" cellpadding="1" class='t1'>
                <thead>
                    <th style="width:30px" align="center" >
                        <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:mCheckAll(this,"chkTransactorID")' />
                    </th>
                    <th style="width:60px" align="center">处理顺序</th>	
	                <th  align="center">处理者</th>	
	                <th style="width:100px" align="center">类型</th>	
	                <th style="width:40px" align="center">操作</th>
                </thead>
                  <asp:Repeater ID="repWF_Transactor" runat="server" >
                  <ItemTemplate>             
                  <tr style="height:25px">
                <td style="width:30px" align="center" >
                        <input type="checkbox" name="chkTransactorID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
                    </td>
	                <td style="width:60px"  align="center"><%# DataBinder.Eval(Container.DataItem, "TransactSerial")%></td>	
	                <td align="left"><%# DataBinder.Eval(Container.DataItem, "TransactorName")%></td>	
	                <td  style="width:100px"  align="center"><%# Honestysoft.Workflow.Model.WFPublicFun.GetEnumText(typeof(Honestysoft.Workflow.Model.WFEnumData.RoleType), DataBinder.Eval(Container.DataItem, "TransactorType") + "")%></td>
                <td  style="width:40px" align="center">
                    <%# Honestysoft.Workflow.Client.WebUI.ScriptHelper.LinkButton.GetGridDeleteButton(DataBinder.Eval(Container.DataItem, "ID") + "",btnDelTransactor.ClientID) %>
	                
                </td>
                  </tr>  
                  </ItemTemplate>
                  </asp:Repeater>
                </table>     
                </div>    
                <asp:HiddenField ID="hiEmployees" runat="server" />
                <asp:HiddenField ID="hiRoles" runat="server" />
                <asp:HiddenField ID="hiPositions" runat="server" />
                <asp:HiddenField ID="hiDepPositions" runat="server" />
                <asp:HiddenField ID="hiPreActs" runat="server" />
                <asp:HiddenField ID="hiEnum" runat="server" />
                <asp:HiddenField ID="hiProc" runat="server" />
        </div>

        <div id="myTab_l_Content2" class="none" style="height:100%;overflow-y:hidden" align="center">
            <div align="right" class="button_area"  style="width:98%"> 
              <asp:Button ID="btnAddActDepend" runat="server" OnClientClick='javascript:return AddActDepend();' Text="新增" OnClick="btnAddActDepend_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" /> 
     
                  <asp:Button ID="btnDelActDepend" Text="删除" OnClick="btnDelActDepend_Click"  runat="server"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />
                  
                </div>
            <table width="98%"  border="1" cellspacing="0" cellpadding="1" class="t1">
              <thead>
                <th style="width:30px" align="center" >
                    <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:mCheckAll(this,"chkActDependID")' />
                </th>
                <th align="center">主单据字段</th>
                <th align="center">依赖单据</th>
                <th align="center">关联字段</th>	
                <th align="center">流程模板</th>	
                <th align="center">活动模板</th>
                <th style="width:40px" align="center">操作</th>
             </thead>
              <asp:Repeater ID="repWF_ActDepend" runat="server" >
              <ItemTemplate>
              <tr>
            <td align="center" >
                    <input type="checkbox" name="chkActDependID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
                </td>          
                <td align="left"><%# DataBinder.Eval(Container.DataItem,"MainColumn") %></td>      	
                <td align="left"><%# ((WF_ActDepend)Container.DataItem).DepWFBill.Name %></td>	
                <td align="left"><%# DataBinder.Eval(Container.DataItem,"RefColumn") %></td>
                <td align="left"><%# ((WF_ActDepend)Container.DataItem).DepJobTemplate.Name%></td>	
                <td align="left"><%# ((WF_ActDepend)Container.DataItem).DepActTemplate.Name%></td>		
            <td align="center">
                <%# WorkflowApply.WFScript.GetDataItemDeleteButton(DataBinder.Eval(Container.DataItem, "ID") + "", btnDelActDepend)%>
            </td>
              </tr>  
              </ItemTemplate>
              </asp:Repeater>
            </table>
        
        
        </div>
        
        <div id="myTab_l_Content3" class="none" style="height:100%;overflow-y:hidden" align="center">
            <div align="right" class="button_area"  style="width:98%"> 
                    <asp:Button ID="btnAddActAccessorialSQL"  runat="server" OnClientClick='javascript:return AddActAccessorial("SQL");' Text="新增SQL" OnClick="btnAddActAccessorialSQL_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />
                    <asp:Button ID="btnAddActAccessorialMethod"  runat="server" OnClientClick='javascript:return AddActAccessorial("Method");' Text="新增程序集" OnClick="btnAddActAccessorialMethod_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />
                      <asp:Button ID="btnDelActAccessorial" Text="删除"   runat="server" OnClientClick="" OnClick="btnDelActAccessorial_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />      
                </div>
            <table width="98%"  border="1" cellspacing="0" cellpadding="1" class="t1" id="Table2">
              <thead>
                <th style="width:30px" align="center" >
                    <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:mCheckAll(this,"chkActAccessorialID")' />
                </th>	
	            <th style="width:60px" align="center">名称</th>	
	            <th align="center">命令</th>	
	            <th style="width:60px" align="center">类型</th>	
	            <th style="width:40px" align="center">操作</th>
              </thead>
              <asp:Repeater ID="repWF_ActAccessorial" runat="server" >
              <ItemTemplate>
              <tr>
            <td align="center" >
                    <input type="checkbox" name="chkActAccessorialID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
                </td>
                <td align="left"><%# DataBinder.Eval(Container.DataItem, "Name")%></td>	
	            <td align="left"><textarea readonly='true' class="input2" style='overflow-y:auto;overflow-x:hidden;width:350px;border:0;background-color:Transparent'><%# DataBinder.Eval(Container.DataItem, "Command")%></textarea></td>
	            <td align="center"><%# Honestysoft.Workflow.Model.WFPublicFun.GetEnumText(typeof(Honestysoft.Workflow.Model.WFEnumData.CommandType), DataBinder.Eval(Container.DataItem, "CommandType")+"")%></td>	
            <td align="center">
	            <%#  WorkflowApply.WFScript.GetDataItemDeleteButton(DataBinder.Eval(Container.DataItem, "ID") + "", btnDelActAccessorial)%>
            </td>
              </tr>  
              </ItemTemplate>
              </asp:Repeater>
            </table>
        </div>
        
        <div id="myTab_l_Content4" class="none" style="height:100%;overflow-y:hidden" align="center">        
            <div align="right" class="button_area"  style="width:98%"> 
                <asp:Button ID="btnAddActVar" Text="新增" runat="server" OnClientClick="return AddActVar();" OnClick="btnAddActVar_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />
                  <asp:Button ID="btnDelActVar" Text="删除"   runat="server" OnClick="btnDelActVar_Click"  class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />      
                </div>
            <table width="98%"  border="1" cellspacing="0" cellpadding="1" class="t1" id="Table3">
              <thead>
                <th style="width:30px" align="center" >
                    <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:mCheckAll(this,"chkActVarID")' />
                </th>
	            <th align="center">变量名称</th>	
	            <th align="center">数据类型</th>	
	            <th align="center">变量值</th>	
	            <th style="width:40px" align="center">操作</th>
              </thead>
              <asp:Repeater ID="repWF_ActVar" runat="server" >
              <ItemTemplate>
              <tr>
            <td align="center" >
                    <input type="checkbox" name="chkActVarID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
                </td>
	            <td align="left"><%# ((WF_ActVar)Container.DataItem).WFVarTemplate.Name %></td>	
	            <td align="left"><%# WFPublicFun.GetEnumText(typeof(WFEnumData.DataType),((WF_ActVar)Container.DataItem).WFVarTemplate.DataType) %></td>
	            <td align="left"><%# DataBinder.Eval(Container.DataItem, "VarValue")%></td>	
            <td align="center">
	            <%# WorkflowApply.WFScript.GetDataItemDeleteButton(DataBinder.Eval(Container.DataItem, "ID") + "", btnDelActVar)%>
	           
            </td>
              </tr>  
              </ItemTemplate>
              </asp:Repeater>
            </table>
            <asp:HiddenField ID="hiVar" runat="server" />
        </div>
    </div>
  </div>
</div>    
        
<table width="100%"  border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td align="center">
        <asp:Button ID="btnSave" Text = "保存" runat="server"  OnClick="btnSave_Click" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />
        <asp:Button ID="btnExit" Text = "退出" runat="server" OnClientClick="window.close();" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" />
    </td>
  </tr>
</table>

</div>
<input type="hidden" id="HidID" runat="server" style="width:0px" />
<input type="hidden" id="HidJobTemplateID" runat="server"  style="width:0px"/>
<input type="hidden" id="HidProjectID" runat="server" style="width:0px" />
<input type="hidden" id="HidNodeKey" runat="server" style="width:0px" />
<input type="hidden" id="HidDecisionType" runat="server" style="width:0px" />
<input type="hidden" id="HidSynFlag" runat="server" style="width:0px" />
<input type="hidden" id="HidFlowXML" name="FlowXML" runat="server" style="width:0px" />

    </form>
    <script language="javascript" type="text/javascript">
    var opener = window.dialogArguments;
    var url = opener.dialogURL;
    var xmlflow = opener.document.all.FlowXML;
    document.getElementById("<%=HidFlowXML.ClientID %>").value=xmlflow.value;   
    
    </script>
   
<script language="javascript" type="text/javascript">
    function OrgData() {
        var Type;
        var ID;
        var Name;
    }
    function OtherData() {
        var Type;
        var ID;
        var Name;
    }
    function GetOtherSelected() {
        var PreActStr = document.getElementById("<%=hiPreActs.ClientID %>").value;
        var EnumStr = document.getElementById("<%=hiEnum.ClientID %>").value;
        var PreActArr;
        if (PreActStr != "") {
            PreActArr = PreActStr.split(",");
        }
        var EnumArr;
        if (EnumStr != "") {
            EnumArr = EnumStr.split(",");
        }
        var iArrLength = 0;
        if (PreActArr != null) { iArrLength += PreActArr.length; }
        if (EnumArr != null) { iArrLength += EnumArr.length; }
        var myOtherDatas;
        if (iArrLength != 0) {
            myOtherDatas = new Array(iArrLength);
        }
        if (myOtherDatas != null) {
            var arrIndex = 0;
            if (PreActArr != null) {
                for (var i = 0; i < PreActArr.length; i++) {
                    var myPreAct = new OtherData();
                    myPreAct.Type = PreActArr[i].split("|")[0];
                    myPreAct.ID = PreActArr[i].split("|")[1];
                    myPreAct.Name = PreActArr[i].split("|")[2];
                    myOtherDatas[arrIndex] = myPreAct;
                    arrIndex++;
                }
            }
            if (EnumArr != null) {
                for (var i = 0; i < EnumArr.length; i++) {
                    var myEnum = new OtherData();
                    myEnum.Type = EnumArr[i];
                    myOtherDatas[arrIndex] = myEnum;
                    arrIndex++;
                }
            }
        }
        return myOtherDatas;
    }
    function GetOrgSelected() {
        var EmployeeStr = document.getElementById("<%=hiEmployees.ClientID %>").value;
        var RoleStr = document.getElementById("<%=hiRoles.ClientID %>").value;
        var PositionStr = document.getElementById("<%=hiPositions.ClientID %>").value;
        var DepPositionStr = document.getElementById("<%=hiDepPositions.ClientID %>").value;
        var EmployeeArr;
        if (EmployeeStr != "") {
            EmployeeArr = EmployeeStr.split(",");
        }
        var RoleArr;
        if (RoleStr != "") {
            RoleArr = RoleStr.split(",");
        }
        var PositionArr;
        if (PositionStr != "") {
            PositionArr = PositionStr.split(",");
        }
        var DepPositionArr;
        if (DepPositionStr != "") {
            DepPositionArr = DepPositionStr.split(",");
        }
        var iArrLength = 0;
        if (EmployeeArr != null) { iArrLength += EmployeeArr.length; }
        if (RoleArr != null) { iArrLength += RoleArr.length; }
        if (PositionArr != null) { iArrLength += PositionArr.length; }
        if (DepPositionArr != null) { iArrLength += DepPositionArr.length; }
        var myOrgDatas;
        if (iArrLength != 0) {
            myOrgDatas = new Array(iArrLength);
        }
        if (myOrgDatas != null) {
            var arrIndex = 0;
            if (EmployeeArr != null) {
                for (var i = 0; i < EmployeeArr.length; i++) {
                    var myEmployee = new OrgData();
                    myEmployee.Type = "Employee";
                    myEmployee.ID = EmployeeArr[i].split("|")[0];
                    myEmployee.Name = EmployeeArr[i].split("|")[1];
                    myOrgDatas[arrIndex] = myEmployee;
                    arrIndex++;
                }
            }
            if (RoleArr != null) {
                for (var i = 0; i < RoleArr.length; i++) {
                    var myRole = new OrgData();
                    myRole.Type = "Role";
                    myRole.ID = RoleArr[i].split("|")[0];
                    myRole.Name = RoleArr[i].split("|")[1];
                    myOrgDatas[arrIndex] = myRole;
                    arrIndex++;
                }
            }
            if (PositionArr != null) {
                for (var i = 0; i < PositionArr.length; i++) {
                    var myPosition = new OrgData();
                    myPosition.Type = "Position";
                    myPosition.ID = PositionArr[i].split("|")[0];
                    myPosition.Name = PositionArr[i].split("|")[1];
                    myOrgDatas[arrIndex] = myPosition;
                    arrIndex++;
                }
            }
            if (DepPositionArr != null) {
                for (var i = 0; i < DepPositionArr.length; i++) {
                    var myDepPosition = new OrgData();
                    myDepPosition.Type = "DepPosition";
                    myDepPosition.ID = DepPositionArr[i].split("|")[0];
                    myDepPosition.Name = DepPositionArr[i].split("|")[1];
                    myOrgDatas[arrIndex] = myDepPosition;
                    arrIndex++;
                }
            }
        }
        return myOrgDatas;
    }
    function SelectHistory(FlowID) {
        var myOtherDatas = GetOtherSelected();
        var Url = "<%= WorkflowApply.Home %>WorkFlow/WFDesigner/OtherTransactorAdd.aspx?JobTemplateID=" + FlowID;
        var retValue = window.showModalDialog(Url, myOtherDatas, 'dialogHeight=500px;dialogWidth=600px;help=no;scrollbars=no;status=no');
        if (retValue != null && retValue.length > 0) {
            var PreActStr = "";
            var EnumStr = "";
            for (var i = 0; i < retValue.length; i++) {
                if (retValue[i].Type == "101606" || retValue[i].Type == "101607" || retValue[i].Type == "101608" || retValue[i].Type == "101609" || retValue[i].Type == "101613") {
                    if (EnumStr == "") {
                        EnumStr = retValue[i].Type;
                    }
                    else {
                        EnumStr += "," + retValue[i].Type;
                    }
                }
                else {
                    if (PreActStr == "") {
                        PreActStr = retValue[i].Type + "|" + retValue[i].ID + "|" + retValue[i].Name;
                    }
                    else {
                        PreActStr += "," + retValue[i].Type + "|" + retValue[i].ID + "|" + retValue[i].Name;
                    }
                }
            }
            document.getElementById("<%=hiPreActs.ClientID %>").value = PreActStr;
            document.getElementById("<%=hiEnum.ClientID %>").value = EnumStr;
            return true;
        }
        else {
            return false;
        }
    }
    function SelectEmployee() {
        var myOrgDatas = GetOrgSelected();
        var Url = "<%= WorkflowApply.Home %>WorkFlow/OrgMapping/SelectOrg.aspx";
        var retValue = window.showModalDialog(Url, myOrgDatas, 'dialogHeight=500px;dialogWidth=600px;help=no;scrollbars=no;status=no');
        if (retValue != null) {
            var EmployeeStr = "";
            var RoleStr = "";
            var PositionStr = "";
            var DepPositionStr = "";
            for (var i = 0; i < retValue.length; i++) {
                if (retValue[i].Type == "Employee") {
                    if (retValue[i].ID != null && (retValue[i].ID + "") != "") {
                        if (EmployeeStr == "") {
                            EmployeeStr = retValue[i].ID + "|" + retValue[i].Name;
                        }
                        else {
                            EmployeeStr += "," + retValue[i].ID + "|" + retValue[i].Name;
                        }
                    }
                }
                else if (retValue[i].Type == "Role") {
                    if (retValue[i].ID != null && (retValue[i].ID + "") != "") {
                        if (RoleStr == "") {
                            RoleStr = retValue[i].ID + "|" + retValue[i].Name;
                        }
                        else {
                            RoleStr += "," + retValue[i].ID + "|" + retValue[i].Name;
                        }
                    }
                }
                else if (retValue[i].Type == "Position") {
                    if (retValue[i].ID != null && (retValue[i].ID + "") != "") {
                        if (PositionStr == "") {
                            PositionStr = retValue[i].ID + "|" + retValue[i].Name;
                        }
                        else {
                            PositionStr += "," + retValue[i].ID + "|" + retValue[i].Name;
                        }
                    }
                }
                else if (retValue[i].Type == "DepPosition") {
                    if (retValue[i].ID != null && (retValue[i].ID + "") != "") {
                        if (DepPositionStr == "") {
                            DepPositionStr = retValue[i].ID + "|" + retValue[i].Name;
                        }
                        else {
                            DepPositionStr += "," + retValue[i].ID + "|" + retValue[i].Name;
                        }
                    }
                }
            }
            document.getElementById("<%=hiEmployees.ClientID %>").value = EmployeeStr;
            document.getElementById("<%=hiRoles.ClientID %>").value = RoleStr;
            document.getElementById("<%=hiPositions.ClientID %>").value = PositionStr;
            document.getElementById("<%=hiDepPositions.ClientID %>").value = DepPositionStr;
            return true;
        }
        else {
            return false;
        }
    }
    function SelectProcedure() {
        var Url = "<%= WorkflowApply.Home %>WorkFlow/WFDesigner/SelectProcedure.aspx";
        var retValue = mOpenDlgReturnObj(Url, 400, 200, "<%=WorkflowApply.Home%>", "新增存储过程接口");
        if (typeof (retValue) != 'undefined' && retValue != null) {
            if (document.getElementById("<%=hiProc.ClientID %>").value != "") {
                document.getElementById("<%=hiProc.ClientID %>").value += ",";
            }
            document.getElementById("<%=hiProc.ClientID %>").value += retValue;
            return true;
        }
        return false;
    }
 //检查obj列表框中是否已经存在选项opt
    function optionExists(obj, value) {
        var length = obj.options.length;
        for (var i = 0; i < length; i++) {
            if (obj.options[i].value == value)
                return true;
        }
        return false;
    }
    function AddActAccessorial(type) {
        var Url = "<%= WorkflowApply.Home %>WorkFlow/WFDesigner/ActAccessorialEdit.aspx?Type=" + type;
        var name = "";
        if (type == "SQL") {
            name = "新增后续操作-SQL";
        }
        else {
            name = "新增后续操作-程序集";
        }
        return mOpenDlg3(Url, 600, 300, "<%=WorkflowApply.Home%>", name);
    }
    function AddActDepend() {
        var Url = "<%= WorkflowApply.Home %>WorkFlow/WFDesigner/ActDependEdit.aspx";
        return mOpenDlg3(Url, 600, 300, "<%=WorkflowApply.Home%>", "新增活动依赖");
    }
    function AddActVar() {
        var IDStr = document.getElementById("<%=hiVar.ClientID %>").value;
        var Url = "<%= WorkflowApply.Home %>WorkFlow/WFDesigner/VarEdit.aspx?Type=<%=((int)Honestysoft.Workflow.Model.WFEnumData.VarArea.ActTemplate).ToString() %>&IDStr=" + IDStr;
        return mOpenDlg3(Url, 600, 300, "<%=WorkflowApply.Home%>", "新增活动变量");
    }
</script>
</body>
</html>
